#include<iostream>
using namespace std;

int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31} ;



int daymonth(int y,int m)
{
	bool leap = y % 4 == 0 && y % 100 || y % 400 == 0;
	if(m==2) 
		return 28+leap;
	return month[m];
}
int main()
{
	int sum=0;
	int week=6;
	for(int i=2000;i<=2020;i++)
	{
		for(int j=1;j<=12;j++)
		{
			for(int k=1;k<=daymonth(i,j);k++)
			{
				if(k==1||week==1)
					sum+=2;
				else
					sum+=1;
				week=(week+1)%7;
				if(i==2020 && j==10 && k==1)
					cout<<sum;
			}
		}
	}
	return 0;
}
